import { reqCategoryList } from "@/api";
const state = {
  categoryList: [],
};
const getters = {};
const mutations = {
  RECEIVE_CATEGORY_LIST(state, categoryList) {
    state.categoryList = categoryList;
  },
};
const actions = {
  async getCategoryList({ commit }, payload) {
    const result = await reqCategoryList();
    if (result.code === 200) {
      commit("RECEIVE_CATEGORY_LIST", result.data);
    }
  },
};

export default {
  state,
  getters,
  mutations,
  actions,
};
